package htmlview;

import java.io.IOException;
import java.io.InputStream;
import java.net.URL;

import javax.swing.JEditorPane;

/**
 * 
 * @author Bing
 *
 */
public class HtmlTextPane extends JEditorPane {
	private IStreamFilter streamFilter = null;

	public HtmlTextPane(){
		this.setEditable(false);
	}
	protected InputStream getStream(URL page) throws IOException {
		InputStream inStream = super.getStream(page);
		if(this.streamFilter!=null){
			return this.streamFilter.filter(inStream);
		}
		return inStream;
	}
	
	public void setInputStreamFilter(IStreamFilter f){
		this.streamFilter = f;
	}

}
